<?php
/**
 * symfony3 - TaskType.php
 * Created by PhpStorm.
 * User: mac
 * Date: 6/11/16
 * Time: 10:41
 * Initial version by: mac
 * Initial version creation at: 6/11/16 10:41
 */
namespace Chap12Bundle\Forms;

use App\Utility\MyService;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\OptionsResolver\OptionsResolver;


class TaskType extends AbstractType
{
	private $myService;

	public function __construct(Myservice $myService)
	{
		$this->myService = $myService;
	}


	public function configureOptions(OptionsResolver $resolver)
	{
		$resolver->setDefaults(array(
			'data_class' => 'Chap12Bundle:Entity:Task'
		));
	}


	public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->add('task')
			->add('dueDate', DateType::class, array('widget'=>'single_text', 'mapped'=>false))
			->add('save', SubmitType::class);
	}
}